<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" style="height: 600px;" data-table-id="Table" >
  <div class="layui-card-body padding-left-40">
      <fieldset class="layui-bg-gray">
          <legend><b class="layui-badge think-bg-violet">下载器</b></legend>

          <div class="layui-row layui-col-space15">
              <div class="layui-col-xs6">
                  <label class="block relative">
                      <span class="help-label"><b>下载器名称</b></span>
                      <input name="name" required vali-name="下载器名称"  class="layui-input">
                      <span class="help-block">自定义</span>
                  </label>
              </div>
              <div class="layui-col-xs6">
                  <label class="block relative">
                      <span class="help-label"><b>类型</b</span>
                      <select name="type" required vali-name="类型"  class="layui-input">
                          <option value="">请选择</option>
                          <option value="1">QB</option>  
                          <option value="2">TR</option>  
                      </select>
                      <span class="help-block">QB|TR</span>
                  </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>地址</b></span>
                    <input name="host"  required vali-name="地址" class="layui-input">
                    <span class="help-block"><a style="color:red">WEBUI地址需要带'http://'</a></span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>端口</b></span>
                    <input name="port" class="layui-input">
                    <span class="help-block">根据自己的下载器端口填写</span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>用户名</b></span>
                    <input name="username" class="layui-input">
                    <span class="help-block">下载器WEBUI的登录用户名</span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>密码</b></span>
                    <input name="password" class="layui-input">
                    <span class="help-block">下载器WEBUI的登录密码</span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>种子目录</b></span>
                    <input name="save_path"  required vali-name="种子目录" class="layui-input">
                    <span class="help-block">填写种子目录在容器中映射的目录</span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>跳过哈希校验</b></span>
                    <select name="is_skip_hash"  required vali-name="是否跳过哈希校验"  class="layui-input">
                      <option value="">请选择</option>
                      <option value="0">否</option>  
                      <option value="1">是</option>  
                    </select>
                    <span class="help-block">有一定风险，后果自负</span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <label class="block relative">
                    <span class="help-label"><b>是否自动开始做种</b></span>
                    <select name="is_paused"  required vali-name="是否自动开始做种"  class="layui-input">
                      <option value="">请选择</option>
                      <option value="0">否</option>  
                      <option value="1">是</option>  
                    </select>
                    <span class="help-block">添加种子后会自动开始任务</span>
                </label>
              </div>
              <div class="layui-col-xs6">
                <div class="block relative">
                    <span class="help-label"><b>辅种站点</b></span>
                    <div id="demo1" class="xm-select-demo"></div>
                    <span class="help-block">选择参与辅种站点</span>
                </div>
              </div>
              <div class="layui-col-xs12">
                <label class="block relative">
                    <span class="help-label"><b>启用</b></span>
                    <select name="status"  required vali-name="启用"  class="layui-input">
                      <option value="">请选择</option>
                      <option value="0">否</option>  
                      <option value="1">是</option> 
                    </select>
                    <span class="help-block">决定了该下载器是否参与辅种</span>
                </label>
              </div>
          </div>
      </fieldset>
  </div>

  <div class="hr-line-dashed"></div>
  {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

  <div class="layui-form-item text-center" style="padding-bottom: 20px;">
      <button class="layui-btn" type='submit'>保存数据</button>
      <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
  </div>
</form>
<script>
    $.ajax({
      url: 'admin/api.sites',
      success: function(result){
        console.log(result.data);
        demo1 = xmSelect.render({
          el: '#demo1',
          name:'reseed_sites',
          toolbar: { show: true },
          data: result.data,
          autoRow: true,
          filterable: true,
          model: {
            label: {
              type: 'block',
              block: {
                //最大显示数量, 0:不限制
                showCount: 3,
                //是否显示删除图标
                showIcon: true,
              }
            }
          },
        });
      }
    });
</script>